-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix/upload limit #3101 #6500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix/upload limit #3101 #6500
Conversation
…updated warning dialog strings, and ensured thumbnail bar consistency
app/src/main/java/fr/free/nrw/commons/customselector/ui/adapter/ImageAdapter.kt
Outdated
Show resolved
Hide resolved
|
@nicolas-raoul Changed from 5 image limit to 20 image limit as per #3101 (comment) |
app/src/main/java/fr/free/nrw/commons/customselector/ui/adapter/ImageAdapter.kt
Outdated
Show resolved
Hide resolved
|
@nicolas-raoul - Made the required changes. |
|
I am travelling (now Hyderabad) so I can't test, but I hope I will be able to do it on Wednesday. Or someone might do it before me. Thank you for your understanding! 🙂 |
Oh, Hyderabad! Wishing you a pleasant journey. I hope you get the chance to explore and enjoy the beauty of the city. |
Removed duplicate import of MAX_IMAGE_COUNT.
Removed duplicate import of MAX_IMAGE_COUNT.
nicolas-raoul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, is this branch only about the system picker inside the app? And #6556 is about sharing to the Commons app from another app?
With this branch, when system picker is used, truncation indeed happens correctly. I did not see a toast, though.
By the way, with this branch I do not see thumbnails anymore in the custom picker.
| numberOfSelectedImagesMarkedAsNotForUpload = 0 | ||
| images.clear() | ||
| selectedImages = arrayListOf() | ||
| selectedImages = ArrayList(selectedImages.take(5)) // enforce the 5-image limit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for not using MAX_IMAGE_COUNT here?
| holder.itemView.setOnClickListener { | ||
| if (!holder.isItemUploaded() && !holder.isItemNotForUpload()) { | ||
| if (selectedImages.size >= MAX_IMAGE_COUNT && !isSelected) { //enforce the 20-image limit | ||
| Toast.makeText(context, "Cannot select more than 20 images", Toast.LENGTH_SHORT).show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for not using MAX_IMAGE_COUNT in the toast?
| uploadingContributionList, | ||
| ) | ||
| scope.launch { | ||
| val sharedPreferences: SharedPreferences = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this part not useful? Does the Show already handled pictures still work as intended?
|
Okay, this one was a bit of a mess and I fully own that. Originally I tried to slap the 20-image limit in a bunch of places half-heartedly, which led to inconsistent behavior (some paths respected the limit, some didn’t, toast missing, thumbnails sometimes broken, etc.). After properly fixing the external share -> Commons flow in #6556, I finally understood the cleanest way to do it, so I came back and cleaned up this branch completely. What this PR now does correctly and consistently:
I’ll open the follow-up PR tomorrow that unifies both flows and removes duplicated code : ) |
…cted images handling
…0 in classic multi-upload flow
|
@nicolas-raoul Updated th PR with all the required changes, Please review it : ) |
Yeah, exactly. |
|
✅ Generated APK variants! |

Description (required)
Fixes #3101
Implemented a strict 20-image selection and upload limit in the Wikimedia Commons app to prevent server overload and align with user feedback. Modified
CustomSelectorActivity.ktandImageAdapter.ktto restrict selection to 5 images, updatedUploadActivity.ktto process only 5 images, added a close button initem_custom_selector_image.xmlfor deselection, updatedcustom_selector_limit_dialog.xmlandstrings.xmlfor a clear 5-image limit message, and ensuredThumbnailsAdapter.ktdisplays only 5 images in the upload UI thumbnail bar.